let sh = document.querySelector('.show')
let reList = document.querySelector('.reList')
let id = getQueryString('productid')
let id1 = getQueryString('categoryid')
let brandname=getQueryString('brandname')
$('.last-a').text(brandname)

fetch('http://chst.vip:1234/api/getproduct?productid=' + id + '&categoryid=' + id1+'&brandname='+brandname)
    .then(body => body.json())
    .then(res => {
        console.log(res)
        let el = ""
        res.result.forEach(item => {
         
            el += `<div>
             <b>${item.productImg}</b>
             <p>${item.productName}</p>
             <div class="dv">${item.bjShop}<div>
            </div>`
        });
        sh.innerHTML=el
    })

fetch('http://chst.vip:1234/api/getproductcom?productid='+id+'&categoryid=' + id1)
.then(body=>body.json())
.then(res1=>{
    console.log(res1)
    let lis = ""
    res1.result.forEach(item=>{
        lis+=`<div><p class="p1"><span>${item.comName}</span> <b>${item.comTime}</b></p>
            <p class="p2">${item.comContent}</p>
            <i>${item.comFrom}</i></div>
        `
    })
    reList.innerHTML=lis;
})